package com.github.kotvertolet.youtubejextractor.models.newModels;

import com.google.gson.annotations.SerializedName;
import ohos.utils.Parcel;
import ohos.utils.Sequenceable;

import java.io.Serializable;

/**
 * 类功能描述(类上)
 *
 * @author AnBetter
 * @since 2021-04-16
 */
public class Embed implements Sequenceable, Serializable {
    @SerializedName("width")
    private int width = 0;
    @SerializedName("flashUrl")
    private String flashUrl;
    @SerializedName("flashSecureUrl")
    private String flashSecureUrl;
    @SerializedName("iframeUrl")
    private String iframeUrl;
    @SerializedName("height")
    private int height = 0;

    public static final Sequenceable.Producer<Embed> CREATOR = new Producer<Embed>() {
        @Override
        public Embed createFromParcel(Parcel parcel) {
            // Initialize an instance first, then do customized unmarshlling.
            Embed embed = new Embed();
            embed.unmarshalling(parcel);
            return embed;
        }
    };

    @Override
    public boolean marshalling(Parcel parcel) {
        parcel.writeInt(this.width);
        parcel.writeString(this.flashUrl);
        parcel.writeString(this.flashSecureUrl);
        parcel.writeString(this.iframeUrl);
        parcel.writeInt(this.height);
        return true;
    }

    @Override
    public boolean unmarshalling(Parcel parcel) {
        this.width=parcel.readInt();
        this.flashUrl=parcel.readString();
        this.flashSecureUrl=parcel.readString();
        this.iframeUrl=parcel.readString();
        this.height=parcel.readInt();
        return true;
    }

    @Override
    public String toString() {
        return "Embed{" +
                "width = '" + width + '\'' +
                ",flashUrl = '" + flashUrl + '\'' +
                ",flashSecureUrl = '" + flashSecureUrl + '\'' +
                ",iframeUrl = '" + iframeUrl + '\'' +
                ",height = '" + height + '\'' +
                "}";
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public String getFlashUrl() {
        return flashUrl;
    }

    public void setFlashUrl(String flashUrl) {
        this.flashUrl = flashUrl;
    }

    public String getFlashSecureUrl() {
        return flashSecureUrl;
    }

    public void setFlashSecureUrl(String flashSecureUrl) {
        this.flashSecureUrl = flashSecureUrl;
    }

    public String getIframeUrl() {
        return iframeUrl;
    }

    public void setIframeUrl(String iframeUrl) {
        this.iframeUrl = iframeUrl;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }
}
